﻿using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SwHelper;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using SolidWorks.Interop.swdocumentmgr;
using System.Diagnostics;
using SwHelper.Assembly;
using System.Runtime.InteropServices;
using System.IO;
using System.Drawing.Imaging;
using SwAssem.Plugin;

namespace TestWin
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Hashtable _hasTable = null;
        private void button1_Click(object sender, EventArgs e)
        {
            _hasTable = new Hashtable();

            SwAppHelper swAppHelper = new SwAppHelper();
            SldWorks swapp = swAppHelper.GetSwApp();

            if (swapp != null)
            {
                //SwUI.Init.InitDlg(swapp);
                SwAssem.MainWindow.Show_MainWindow(swapp);
            }

        }



        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //string objStr = listBox1.SelectedItem as string;
            //SwAppHelper swAppHelper = new SwAppHelper();
            //SldWorks swapp = swAppHelper.GetSwApp();
            //ModelDoc2 _doc = swapp.ActiveDoc;
            //object _obj = _hasTable[objStr];
            //byte[] ID = (byte[])_obj;
            //int errorcode = 0;



            //Note note = (Note)_doc.Extension.GetObjectByPersistReference3(ID, out errorcode);

            //this.label1.Text = _doc.GetEntityName(note);


            //this.label1.Text = false.ToString();
        }
    }

}
